//
//  ShopingViewController.m
//  壳牌喜力促销积分商城
//
//  Created by TUSM on 15/3/10.
//  Copyright (c) 2015年 shell. All rights reserved.
//

#import "ShopingViewController.h"
#import "DuiHuanViewController.h"
#import "GWTableViewController.h"
@interface ShopingViewController ()


@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UIScrollView *scoreView;



@property (weak, nonatomic) IBOutlet UILabel *scores;
@property (weak, nonatomic) IBOutlet UITextView *intro;

- (IBAction)GWBtn:(UIButton *)sender;
- (IBAction)DuiHuanClick;

@end

@implementation ShopingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"商品详情";
//  导航栏右边按钮
    
    
    UIBarButtonItem *rightButton = [[UIBarButtonItem alloc]
                                     initWithTitle:@"返回"
                                     style:UIBarButtonItemStyleBordered
                                     target:self
                                     action:@selector(backRootViewcontroller)];
    
//    rightButton.image=[UIImage imageNamed:@"right_button.png"];
//    rightButton.tintColor=[UIColor colorWithRed:74/255.0 green:74/255.0 blue:74/255.0 alpha:1.0];

    self.navigationItem.rightBarButtonItem = rightButton;
    
    self.tabBarController.tabBar.hidden = YES;
    
//    self.view.backgroundColor = [UIColor blueColor];
//    UIView *imageV = [[UIView alloc] init];
//    imageV.frame = CGRectMake(100, 100, 300, 400);
//    imageV.backgroundColor = [UIColor orangeColor];
//    [self.view addSubview:imageV];
    self.scoreView.backgroundColor = [UIColor orangeColor];
    

    CGRect temp  = self.scoreView.bounds;
    temp.size.width = [UIScreen mainScreen].bounds.size.width;
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:temp];
    imageView.contentMode = UIViewContentModeScaleToFill;
    imageView.image = [UIImage imageNamed:@"9b437cdfb3e3b542b5917ce2e9a74890.jpg"];
    [self.scoreView addSubview:imageView];
}

- (void)backRootViewcontroller
{
    [self.navigationController popToRootViewControllerAnimated:YES];
    

}

- (IBAction)GWBtn:(UIButton *)sender {
    
    //1.跳转到购物车
  GWTableViewController   *GouWuVc = [[GWTableViewController alloc]init];
    
    

     GouWuVc.title = @"购物车";
    [self.navigationController pushViewController: GouWuVc animated:YES];
    
    
    
    //2.把商品数据加入到购物车
    
    
    //3.刷新购物车数据
    
    
}

- (IBAction)DuiHuanClick {
    NSLog(@"点击兑换");
// DuiHuanViewController *duiHuanVc = [[[NSBundle mainBundle]loadNibNamed:@"DuiHuanViewController" owner:nil options:nil]lastObject];
    
    DuiHuanViewController *duiHuanVc = [[DuiHuanViewController alloc]init];
    
    
    
    duiHuanVc.title = @"确认订单";
    [self.navigationController pushViewController:duiHuanVc animated:YES];
    
    
}
@end
